<template>
    <div>
        <img src="../../assets/images/prefume/17041988803126670.png" style="width: 100%;">
        <div class="perfumegoods-box padding-item">
            <div class="padding-txt">
                <h2>香水</h2>
                <span>首页>香水</span>
            </div>
            <div class="padding-goods" v-if="perfumeList!==null">
                <div class="good_item" v-for="(item,index) in perfumeList.list" :key="index" @click="checkDetail(item.goodsId)">
                    <div class="good_img">
                        <img style="width: 100%;height: 100%;" :src="require('../../assets/images/' + item.coverImg)" />
                    </div>
                    <div class="good_txt">{{ item.goodsName }}</div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import { loadDataList } from '@/utils/api/goods';

export default {
    data(){
        return {
            perfumeList:null
        }
    },
    created(){
        const that=this
        loadDataList({categoryId:3}).then(data=>{
            that.perfumeList=data
        })
    },
    methods:{
        checkDetail(goodsId){
            this.$router.push({
                path:"/detailGood",
                query:{
                    id:goodsId
                }
            })
        }
    }
}
</script>